using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;

namespace TBOCrypto
{
    public partial class NodeSelection : Form
    {
        public NodeSelection()
        {
            InitializeComponent();
        }

        private void NodeSelection_Load(object sender, EventArgs e)
        {

        }

        public void LoadTree(XmlDocument xmlDoc)
        {
            XmlNodeList list = xmlDoc.ChildNodes;

            AddNodes(list[1].ChildNodes);
        }

        private void AddNodes(XmlNodeList list)
        {
            foreach (XmlNode node in list)
            {
                
                if (node.NodeType != XmlNodeType.Text) tvSelectEncNode.Nodes.Add(new TreeNode(node.LocalName));
                
                if (node.HasChildNodes)
                {
                    AddNodes(node.ChildNodes);
                }
            }
        }
    }
}